import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { MemberService } from '../member.server';

@Component({
  selector: 'app-member-center-message-detail',
  templateUrl: './member-center-message-detail.component.html',
  styleUrls: ['./member-center-message-detail.component.scss']
})
export class MemberCenterMessageDetailComponent implements OnInit {

  private _derail:any;
  
  ngOnInit() {
    this.loadDetail('消息详情', this.route.snapshot.queryParams)
  };

  async loadDetail(url,data) {
    let tag = await this.memberServer.getAJX(url,data);
    this.memberServer.getApiSuccess(tag,false) ? this.successListOk(tag.data, url) : '';
  };

  public successListOk(data,url):void{
    switch (url) {
      case '消息详情':
        this._derail = data;
        console.log(data)
        break;
    };
  };
  
  constructor(
    private memberServer: MemberService,
    private route: ActivatedRoute
  ) { }
}
